/*************************************************************************
	> File Name: oj-551.cpp
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2020年12月31日 星期四 16时31分58秒
 ************************************************************************/
#include <iostream>
#include <cstdio>
using namespace std;

int nums[2][2005];

int main() {
    int n; 
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        scanf("%d", &nums[0][i]);
    }
    for (int i = 1; i <= n; ++i) {
        nums[1][i] = 1;
        for (int j = 1; j < i; ++j) {
            if (nums[0][j] >= nums[0][i])
                nums[1][i] = max(nums[1][i], nums[1][j] + 1);
        }
    }
    int ans = 0;
    for (int i = 1; i <= n; ++i) {
        ans = max(ans, nums[1][i]);
    }
    cout << ans << endl;
    return 0;
}
